package com.accloud.cloudservice;

import com.accloud.service.ACDeviceMsg;
import com.accloud.utils.LogUtil;

import org.apache.commons.codec.binary.Hex;
import org.json.JSONException;

/* access modifiers changed from: package-private */
public class ControlEvent extends ACEvent {
    public static final String CLOUD = "cloud";
    public static final String LOCAL = "LAN";

    ControlEvent(String eventName, String subDomain, String physicalDeviceId, ACDeviceMsg msg) {
        super("apm_app_device_control", eventName, null);
        try {
            this.subDomain = subDomain;
            this.physicalDeviceId = physicalDeviceId;
            LogUtil.d("ControlEvent msg->"+msg.toString());
            this.data.put("msg_code", msg.getCode());
            if (null != msg.getContent()) {
                this.data.put("value", new String(Hex.encodeHex(msg.getContent())));
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
}
